package com.five.sbgroup5job.controller;
//胡进茹
import com.five.sbgroup5job.entity.Buy;
import com.five.sbgroup5job.service.BuyService;
import com.five.sbgroup5job.vo.BuyVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/buy")

public class BuyController {
    @Resource
    private BuyService buyService;
    //查询
    @RequestMapping ("buys")
    public List<Buy> buyList(){
        return buyService.buylist();
    }
    //添加
    @RequestMapping ("buysAdd")
    public String buyList(@RequestBody BuyVo buyVo){
        return buyService.buyAdd(buyVo);
    }
    //更改
    @RequestMapping ("buysUpdate")
    public String buyList1(@RequestBody BuyVo buyVo){
        return buyService.buyUpdate(buyVo);
    }
    //删除
    @RequestMapping ("buysDelete")
    public String buyList2(@RequestBody BuyVo buyVo){
        return buyService.buyDelete(buyVo);
    }



}
